package fatboy.communication;

import java.io.Serializable;

public class BasicLocal implements Serializable, Basic{
	/**
	 *  The normal basic object.  Is uniquely identified by a ObjectID
	 */
	private static final long serialVersionUID = 1L;
	private String var;
	private ObjectID id;
	/**
	 * 
	 * @param in String that will be stored in this Basic Object
	 */
	public BasicLocal(String in){
		id = new ObjectID();
		setVar(in);
	}
	/**
	 *  mostly a testing constructor, allows you to mandate an ObjectID
	 *   instead of it being set for you
	 * @param in String to be stored in this basic Object
	 * @param idIn ObjectID to be used to identify this Object
	 */
	public BasicLocal(String in, ObjectID idIn){
		id = new ObjectID(idIn);
		setVar(in);
	}
	/**
	 * 
	 * @return ObjectID that uniquely identifies this object 
	 */
	public ObjectID getID(){
		return id;
	}
	/***
	*	@param in that is to replace old varible. 
	*/
	public void setVar(String in){
		var = in;
		
	}
	/***
	*	@return the Varible stored inside the Basic
	*
	*	@throws IOException if a proxy object has trouble connecting remotely
	*
	***/
	public String getVar(){
		return var;
	}
	/***
	*	@param first is summed together with second
	*
	*	@param second is summed together with first
	*
	*	@return the sum of the two varibles
	*/
	public int add(int first, int second){
		return first+second;
	}
	
}
